## First stage - compile
#FROM registry.cn-hangzhou.aliyuncs.com/acs/maven:3-jdk-8 AS build-stage
#
#ENV APP_HOME=/app
#RUN mkdir -p $APP_HOME
#WORKDIR $APP_HOME
#ADD pom.xml $APP_HOME
##ADD /root/.m2/ /root/.m2/
##RUN mvn dependency:go-offline
#
## get all the download out of the way
#RUN ["/usr/local/bin/mvn-entrypoint.sh", "mvn", "verify", "clean", "--fail-never"]
#
## add source
#ADD . $APP_HOME
#
#RUN ["/usr/local/bin/mvn-entrypoint.sh", "mvn", "verify"]
#
## Second stage - build
## FROM openjdk:8-jre-alpine
#FROM openjdk:8
#
#RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai'>/etc/timezone
#ENV APP_HOME=/app
#WORKDIR $APP_HOME
#
#COPY --from=build-stage /app/eladmin-system/target/*.jar app.jar
#
#ENV JAVA_OPTS="-Xms1024M -Xmx1024M -Xmn256M"
#
#EXPOSE 8000
#
#ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -jar app.jar"]

######################### 以下内容为本地打包专用 #########################
FROM openjdk:8

RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai'>/etc/timezone
ENV APP_HOME=/app
RUN mkdir -p $APP_HOME
WORKDIR $APP_HOME

COPY ./ruoyi-admin/target/*.jar app.jar

ENV JAVA_OPTS="-Xms1024M -Xmx1024M -Xmn256M"

EXPOSE 8080

ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -jar app.jar"]
